package JVM;

/*
 * @Author: qianmingtian
 * @Date: 2020-07-21 10:11:30
 * @LastEditors: qianmingtian
 * @LastEditTime: 2020-07-21 11:50:23
 * @FilePath: \qianmingtian.github.io\code\JVM\TestTenureSizeThreshold.java
 */
/**
 * java -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 TestTenureSizeThreshold
 * 
 * Heap PSYoungGen total 9216K, used 984K [0x00000000ff600000,
 * 0x0000000100000000, 0x0000000100000000) eden space 8192K, 12% used
 * [0x00000000ff600000,0x00000000ff6f6398,0x00000000ffe00000) from space 1024K,
 * 0% used [0x00000000fff00000,0x00000000fff00000,0x0000000100000000) to space
 * 1024K, 0% used [0x00000000ffe00000,0x00000000ffe00000,0x00000000fff00000)
 * ParOldGen total 10240K, used 8192K [0x00000000fec00000, 0x00000000ff600000,
 * 0x00000000ff600000) object space 10240K, 80% used
 * [0x00000000fec00000,0x00000000ff400010,0x00000000ff600000) Metaspace used
 * 2559K, capacity 4486K, committed 4864K, reserved 1056768K class space used
 * 287K, capacity 386K, committed 512K, reserved 1048576K
 */

public class TestTenureSizeThreshold {
    private static final int _1MB = 1024 * 1024;
    

    @SuppressWarnings("unused")
    public static void main(String[] args) {
        byte[] allocation1;
        byte[] allocation2;
        byte[] allocation3;
        allocation1 = new byte[_1MB / 4];
        allocation2 = new byte[4 * _1MB];
        allocation3 = new byte[4 * _1MB];
        allocation3 = null;
        allocation3 = new byte[4 * _1MB];
        allocation3 = new byte[4 * _1MB];
        allocation1 = null;
        allocation2 = null;
        allocation3 = new byte[4 * _1MB];


    }

}